package Event.lib;

import Creature.Food;
import Creature.Player;
import Event.Story;




public class Shop extends Story {
    public Shop(Player player){
        super(player);

        eventName = "超市购物";
        happenText = "这天晚上你在街上闲逛，看到超市开门，虽然现在的东西都很贵，但你还是决定进去看一下";
        options = new String[]{"什么都不买", "买2桶汤达人", "要商店老板娘的电话","买把水果刀"};
    }

    @Override
    public void eventHappen(int option) {
        switch (option) {
            case 0:
                endText = "你就是饿死也不会给超市赚一分钱！";

                break;
            case 1:
                if(player.getMoney()>=100) {
                    endText = "你忍痛买了2桶汤达人";
                    player.foods.add(new Food("汤达人"));
                    player.foods.add(new Food("汤达人"));
                    player.setMoney(player.getMoney() - 100);
                }else {endText = "你钱不够";}
                break;

            case 2:
                endText = "老板娘给你留下了电话：8333888并让你晚点去附近的宾馆找她，结果走到一半突然想起家里花没浇就回去了";
                break;
            case 3:
                endText = "你花了大价钱买了一把水果刀，终于打得过鸡了！";
                player.setPower(player.getPower() + 10);
                player.setMoney(player.getMoney()-300);
                break;
        }
    }

    @Override
    public boolean canHappen(Player player) {
        return true;
    }
}
